package com.dlc.beijingrfid.adapter;

import com.dlc.commonlibrary.adapter.BaseRecyclerAdapter;
import com.dlc.commonlibrary.utils.ResUtil;
import com.dlc.beijingrfid.R;
import com.dlc.beijingrfid.model.intfc.ProductList;

/**
 * Created by John on 2017/7/19.
 */

public class ProductListAdapter<T extends ProductList> extends BaseRecyclerAdapter<T> {

    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.item_product_list;
    }

    @Override
    public void onBindViewHolder(CommonHolder holder, int position) {
        ProductList item = getItem(position);
        holder.setText(R.id.tv_name, item.getName());
        holder.setText(R.id.tv_amount, ResUtil.getString(R.string.x_tiao, item.getAmount()));
        holder.setText(R.id.tv_spec, item.getSpec());
        holder.setText(R.id.tv_manufacturer, item.getManufacturer());
        holder.setText(R.id.tv_where, item.getWhere());
    }
}
